<template>
	<view class="order">
		<view class="statistics">
			<view class="ul">
				<view class="li">
					<text>{{ whole.size }}</text>
					<view>盘点数量(个)</view>
				</view>
				<view class="li">
					<text>{{ whole.orderAmount }}</text>
					<view>款数合计(个)</view>
				</view>
			</view>
		</view>
		<view class="table">
			<view class="th">
				<view class="tr">货号</view>
				<view class="tr">颜色</view>
				<view class="tr">尺码</view>
				<view class="tr">数量</view>
				<view class="tr">操作</view>
			</view>
			<view class="td">
				<view class="tb">小圆晓</view>
				<view class="tb">35953</view>
				<view class="tb">1589</view>
				<view class="tb">2564</view>
				<view class="tb">7896</view>
			</view>
			<view class="td">
				<view class="tb">小圆晓</view>
				<view class="tb">35953</view>
				<view class="tb">1589</view>
				<view class="tb">2564</view>
				<view class="tb">7896</view>
			</view>
			<view class="td">
				<view class="tb">小圆晓</view>
				<view class="tb">35953</view>
				<view class="tb">1589</view>
				<view class="tb">2564</view>
				<view class="tb">7896</view>
			</view>
		</view>
		<view class="pagination">
			<view class="left" :class="{ forbid: paging.page == 1 }" @click="prev">
				<uni-icons type="arrowleft" size="20" color="#fff" class="icons" />
				上一页
			</view>
			<view class="center">{{ paging.page }}/{{ paging.total }}</view>
			<view class="right" :class="{ forbid: paging.page == paging.total }" @click="next">
				下一页
				<uni-icons type="arrowright" size="20" color="#fff" class="icons" />
			</view>
		</view>
	</view>
</template>

<script>
import { uniNavBar, uniIcons } from '@dcloudio/uni-ui';
import check from '../../../servers/entrepot/check.js';
export default {
	components: { uniNavBar, uniIcons },
	data() {
		return {
			id: null,
			active: 1,
			dataList: [1],
			whole: '',
			myList: [],
			paging: {
				page: 1,
				total: 100
			}
		};
	},
	mounted() {
		var _this = this
		uni.getStorage({
		    key: 'entrepotdetails',
		    success: function (res) {
		        _this.id = res.data;
				_this.initData();
		    }
		});
	},
	methods: {
		initData() {
			/* 默认初始化提交订单页面 */
			uni.showLoading({
				title: '数据加载中'
			});
				this.dataList = [];
				var da = {
					checkId:this.id
				}
				check
					.detalis(da)
					.then(res => {
						this.dataList = res.data.record
						this.paging.page=res.data.current
						uni.hideLoading();
					})
					.catch(err => {
						console.log(new Error('请检查网络后重试'));
					});
		},
		back() {
			uni.navigateBack({
				delta: 1
			});
		},
		cut(e) {
			this.active = e;
			this.initData(); //初始化数据
		},
		find() {
			uni.navigateTo({
				url: './orderfind'
			});
		},
		go_examine(orderId) {
			uni.setStorage({
			    key: 'orderId',
			    data: orderId,
			    success: function () {
			        uni.navigateTo({
			            url: '/pages/agent/order/orderclaim'
			        });
			    }
			});
		},
		go_details(orderId) {
			if (this.active != 2) {
				/* 审核订单不跳转 */
				uni.setStorage({
					key: 'orderId',
					data: orderId,
					success: function () {
						uni.navigateTo({
							url: '/pages/agent/order/orderdetails'
						});
					}
				});
			}
		},
		next() {
			if (this.paging.page < this.paging.total) {
				this.paging.page += 1;
			}
		},
		prev() {
			if (this.paging.page > 1) {
				this.paging.page -= 1;
			}
		}
	}
};
</script>

<style lang="less" scoped>
page {
	background: #ffffff;
}
.order {
	.statistics {
		margin: 20rpx;
		background: #ffffff;
		border-radius: 10rpx;
		box-shadow: 5rpx 0px 20rpx #c5c5c5;
		.ul {
			padding: 10rpx;
			line-height: 117rpx;
			display: flex;
			flex-direction: row;
			font-size: 26rpx;
			border-bottom: 1px solid #e1e1e1;
			.li {
				width: 50%;
				text {
					font-size: 32rpx;
					color: #f70225;
				}
			}
			.li:nth-child(1) {
				padding-left: 41rpx;
			}
		}
	}
	.table {
		margin: 50rpx 20rpx 0;
		border-right: 1px solid #e1e1e1;
		border-top: 1px solid #e1e1e1;
		.th,
		.td {
			display: flex;
			flex-direction: row;
			line-height: 94rpx;
			border-bottom: 1px solid #e1e1e1;
			.tr,
			.tb {
				width: 126rpx;
				text-align: center;
				font-size: 26rpx;
				padding: 0 10rpx;
				border-left: 1px solid #e1e1e1;
				box-sizing: border-box;
			}
			.tr:nth-child(1),
			.tb:nth-child(1) {
				width: 225rpx;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}
		}
		.th {
			background: #f4f4f4;
		}
	}
}
</style>
